<li class="dropdown navbar-userinfo">
    {if $user}
    <a href="{:url('index/user/index')}" class="dropdown-toggle" data-toggle="dropdown">
        <span class="avatar-img pull-left"><img src="{$user.avatar|cdnurl|htmlentities}" style="width:30px;height:30px;border-radius:50%;" alt=""></span>
        <span class="visible-xs pull-left ml-2 pt-1">{$user.nickname|htmlentities} <b class="caret"></b></span>
    </a>
    {else /}
    <a href="{:url('index/user/index')}" class="dropdown-toggle" data-toggle="dropdown">会员<span class="hidden-sm">中心</span> <b class="caret"></b></a>
    {/if}
    <ul class="dropdown-menu">
        {if $user}
        <li><a href="{:url('index/user/index')}"><i class="fa fa-user fa-fw"></i> 会员中心</a></li>
        {php}$sidenav = array_filter(explode(',', config('cms.usersidenav')));{/php}
        {if in_array('myhomepage', $sidenav)}
        <li><a href="{:addon_url('cms/user/index', [':id'=>$user['id']])}"><i class="fa fa-user-circle fa-fw"></i> 我的个人主页</a></li>
        {/if}
        {if in_array('myarchives', $sidenav)}
        <li><a href="{:url('index/cms.archives/my')}"><i class="fa fa-list fa-fw"></i> 我发布的文档</a></li>
        {/if}
        {if in_array('postarchives', $sidenav)}
        <li><a href="{:url('index/cms.archives/post')}"><i class="fa fa-pencil fa-fw"></i> 发布文档</a></li>
        {/if}
        {if in_array('myorder', $sidenav)}
        <li><a href="{:url('index/cms.order/index')}"><i class="fa fa-shopping-bag fa-fw"></i> 我的消费订单</a></li>
        {/if}
        {if in_array('mycomment', $sidenav)}
        <li><a href="{:url('index/cms.comment/index')}"><i class="fa fa-comments fa-fw"></i> 我发表的评论</a></li>
        {/if}
        {if in_array('mycollection', $sidenav)}
        <li><a href="{:url('index/cms.collection/index')}"><i class="fa fa-bookmark fa-fw"></i> 我的收藏</a></li>
        {/if}
        <li><a href="{:url('index/user/logout')}"><i class="fa fa-sign-out fa-fw"></i> 退出</a></li>
        {else /}
        <li><a href="{:url('index/user/login')}"><i class="fa fa-sign-in fa-fw"></i> 登录</a></li>
        <li><a href="{:url('index/user/register')}"><i class="fa fa-user-o fa-fw"></i> 注册</a></li>
        {/if}
    </ul>
</li>